var exec = require("child_process").exec;


/*function start(){
	console.log("----Request handler 'start' was called.\n");

	function sleep(milliSeconds){
		var startTime = new Date().getTime();
		while(new Date().getTime() < startTime + milliSeconds);
	}
	sleep(5000);  //模拟阻塞
	
	return 'Hello Start';
}*/

function start(){
	console.log("----Request handler 'start' was called.\n");
	var content = 'empty';
	exec("dir /S /b F:\ | find /i 'index.js'", function(error,stdout,stderr){
		content = stdout;
	});
	return content;
}


function upload(){
	console.log("----Request handler 'upload' was called.\n")
	return 'Hello Upload';
}

exports.start = start;
exports.upload = upload;